package com.qf.utils;

public class ResultVo<T> {
    private Integer status;
    private String message;
    private T data;


    public ResultVo() {
    }

    private ResultVo(Integer status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public static<T> ResultVo success(Integer status, String message, T data){
        ResultVo resultVo = new ResultVo(status, message, data);
        return  resultVo;
    }
    public static<T> ResultVo error(Integer status, String message){
        ResultVo resultVo = new ResultVo(status, message, null);
        return  resultVo;
    }

    /**
     * 获取
     * @return status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置
     * @param status
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取
     * @return message
     */
    public String getMessage() {
        return message;
    }

    /**
     * 设置
     * @param message
     */
    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 获取
     * @return data
     */
    public T getData() {
        return data;
    }

    /**
     * 设置
     * @param data
     */
    public void setData(T data) {
        this.data = data;
    }

    public String toString() {
        return "ResultVo{status = " + status + ", message = " + message + ", data = " + data + "}";
    }
}
